package org.springframework.android.showcase.location;

import org.iside.android.showcase.R;

import android.os.Bundle;

import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.MapActivity;

public class MyMapActivity extends MapActivity {

    BMapManager mBMapMan = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mBMapMan = new BMapManager(getApplication());
        mBMapMan.init("3D91A39F09BF80DF2E452E64B69A972BC2F7862D", null);

        super.initMapActivity(mBMapMan);
//        MapView mMapView = (MapView) findViewById(R.id.bmapsView);

//        mMapView.setBuiltInZoomControls(true); // 设置启用内置的缩放控件
//
//        MapController mMapController = mMapView.getController(); // 得到 mMapView 的控制权,可以用它控制和驱动平移和缩放
//
//        GeoPoint point = new GeoPoint((int) (39.915 * 1E6), (int) (116.404 * 1E6)); // 用给定的经纬度构造一个 GeoPoint，单位是微度 (度 *
//                                                                                    // 1E6)
//
//        mMapController.setCenter(point); // 设置地图中心点
//
//        mMapController.setZoom(12); // 设置地图 zoom 级别

    }

    @Override
    protected void onDestroy() {
        if (mBMapMan != null) {
            mBMapMan.destroy();
            mBMapMan = null;
        }
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        if (mBMapMan != null) {
            mBMapMan.stop();
        }
        super.onPause();
    }

    @Override
    protected void onResume() {
        if (mBMapMan != null) {
            mBMapMan.start();
        }
        super.onResume();
    }

    @Override
    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        return false;
    }

}
